﻿#region File Description
//-----------------------------------------------------------------------------
// SaveGameScreen.cs
//-----------------------------------------------------------------------------
#endregion

#region Using Statements
using Microsoft.Xna.Framework;
using System;
using ManagerGame.GameSavingLogic;
using Microsoft.Xna.Framework.Storage;
#endregion

namespace ManagerGame
{
    /// <summary>
    /// This screen gives a player an option
    /// </summary>
    class SaveGameScreen : MenuScreen
    {
        #region Fields
        MenuEntry saveGame;
        string gameDate;
        #endregion

        #region Initialization


        /// <summary>
        /// Constructor.
        /// </summary>
        public SaveGameScreen()
            : base("Save Game")
        {
            // Create our menu entries.

            gameDate = "game_" + DateTime.Now.ToString("MMM_d_HHmmss");
            saveGame = new MenuEntry("game_" + gameDate);


            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            saveGame.Selected += saveGameSelected;


            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(saveGame);

            MenuEntries.Add(back);
        }





        #endregion

        #region Handle Input

        /// <summary>
        /// Event handler for game saving
        /// </summary>
        void saveGameSelected(object sender, PlayerIndexEventArgs e)
        {
            //StorageDevice device;
            //result = StorageDevice.BeginShowSelector(
            //                PlayerIndex.One, null, null);

            //if (result.IsCompleted)
            //{
            //    device = StorageDevice.EndShowSelector(result);
            //    GameSavingLogic.GameSaver.ManagerData managerData = new GameSaver.ManagerData(Manager.Instance);
            //    GameSaver.SaveManagerData(managerData, device,);
            //}
            //ScreenManager.RemoveScreen(this);
            //string message = "Game Saved!";
            //MessageBoxScreen confirmEndTurntMessageBox = new MessageBoxScreen(message);

            //ScreenManager.AddScreen(confirmEndTurntMessageBox, null);

        }

        #endregion
    }
}
